package demo1;
//Test.java
public class Test {
    public static void main(String[] args) {
        Rect rect=new Rect();
        Cycle cycle=new Cycle();
        Flower flower=new Flower();
        Shape[] shapes={rect,cycle,flower,rect};

        for (Shape shape:shapes
             ) {
            shape.draw();
        }
    }
}
//        for (String shape:shapes
//             ) {
//            if(shape.equals("rect")){
//                rect.draw();
//            }
//            else if(shape.equals("cycle")){
//                cycle.draw();
//            }
//            else{
//                flower.draw();
//            }
//        }